package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.PayPlanUserEntity;
import com.xbongbong.saas.domain.entity.UserTeamEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/4/11 15:14
 * @since v1.0
 */
@Repository
@Mapper
public interface PayPlanUserDao {
    void insertBatch(@Param("list")List<PayPlanUserEntity> paymentUserEntityList);

    void disbandedTeamByCustomerId(@Param("corpid") String corpid, @Param("customerIdIn") List<Long> customerIdList);

    List<PayPlanUserEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer update(PayPlanUserEntity payPlanUserEntity);

    List<UserTeamEntity> findBaseEntitys(@Param("param") Map<String,Object> map);

    void batchDeleteById(@Param("corpid") String corpid, @Param("idIn") List<Long> removeIdList);

    void batchUpdateByIdIn(@Param("corpid")String corpid, @Param("idIn")List<Long> dataIdIn, @Param("isMain")Integer isMain, @Param("del")Integer del);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    PayPlanUserEntity getByKey(@Param("key")Long key, @Param("corpid")String corpid);

    Integer insert(PayPlanUserEntity payPlanUserEntity);


    /**
     * 批量修改团队里面成员为协同人以及协同人可编辑权限
     *
     * @param corpid
     * @param idIn
     * @param isMain
     * @param formPermission
     */
    void batchUpdateCoAndPerByUserIdIn(@Param("corpid")String corpid, @Param("idIn")List<Long> idIn, @Param("isMain")Integer isMain, @Param("formPermission")Integer formPermission);

}
